package arch.coal.ellipse.security.tables;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.LinkedList;

import org.apache.log4j.Logger;

import arch.coal.ellipse.security.data.MSF100;



public class TableMSF100 extends BasicTable {
	
	private LinkedList dataList;
	static Logger logger = Logger.getLogger(TableMSF100.class);
	
	void populateSqlSelectStmt() {
		sqlSelectStmt.append("SELECT");
		sqlSelectStmt.append(" stock_code, group_code, class_code, stock_type,");
		sqlSelectStmt.append(" item_name_code, item_name, desc_linex1, desc_linex2 ");
		sqlSelectStmt.append("FROM MSF100 ");
	}
	
	void setTableName(String table) {
		tableName = "MSF100";
	}

	public void processResultSet(ResultSet rs) {
		
		dataList = new LinkedList();
		
		try {
			while ( rs.next() ) {
				MSF100 data = new MSF100();
				data.setStock_code(rs.getString(1));
				data.setGroup_code(rs.getString(2));
				data.setClass_code(rs.getString(3));
				data.setStock_type(rs.getString(4));
				data.setItem_name_code(rs.getString(5));
				data.setItem_name(rs.getString(6));
				data.setDesc_linex1(rs.getString(7));
				data.setDesc_linex2(rs.getString(8));
				
				dataList.add(data);
			}
		} catch (SQLException se) {
			logger.error("EXCEPTION while getting result set", se);
			se.printStackTrace();
		}
	}
	
	public LinkedList getDataList() {
		return dataList;
	}

}
